package com.ccc.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.ccc.dao.AreaDao;
import com.ccc.model.Area;
import com.ccc.util.dao.UtilDao;

@Component("areaDao")
public class AreaDaoImpl implements AreaDao {
	private UtilDao utilDao;

	@Override
	public void addArea(Area area) {
		utilDao.save(area);
	}

	@Override
	public void deleteArea(Area area) {
		utilDao.delete(area);
	}

	@Override
	public void updateArea(Area area) {
		utilDao.update(area);
	}

	@Override
	public Area findArea(int id) {
		return utilDao.find(Area.class, id);
	}

	public UtilDao getUtilDao() {
		return utilDao;
	}
	@Resource
	public void setUtilDao(UtilDao utilDao) {
		this.utilDao = utilDao;
	}

	@Override
	public List<Area> findAllArea(String sql, Object[] o) {
		return utilDao.find(sql,o);
	}

}
